<?php

class Adept_Template_Modificator_PhpWrapper extends Adept_Template_Modificator_Abstract 
{
    
    protected $phpFunction;
   
    public function makeExpression() 
    {
        $result = $this->getPhpFunction() . '(' . $this->base->makeExpression();
    	foreach ($this->getParameters() as $parameter) {
    	    $result .= ', ' . $parameter->makeExpression();
    	}
    	$result .= ')';
    	return $result;
    }	
    
    public function getPhpFunction() 
    {
        return ($this->phpFunction != null) ? $this->phpFunction : $this->getInfo()->getParameter('phpFunction');
    }
    
    public function setPhpFunction($phpFunction) 
    {
        $this->phpFunction = $phpFunction;
    }

}
